package com.waya.demo.executors;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ExecutorsCreate {
	public static void main(String[] args) {
		ExecutorService executorService = new ThreadPoolExecutor(5, 10, 10, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(5));
		for (int i = 0; i < 20; i++) {
			executorService.execute(new Runnable() {
				
				@Override
				public void run() {
					System.out.println("开始执行线程池中的任务");
				}
			});
		}
	}

}
